Skip to content

Update GitHub Copilot instructions for SMRF#72

Merged
jomey merged 3 commits intomainfrom
copilot/add-copilot-instructions-for-smrf
Apr 21, 2026
Merged

Update GitHub Copilot instructions for SMRF#72
jomey merged 3 commits intomainfrom
copilot/add-copilot-instructions-for-smrf

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Creates .github/copilot-instructions.md to give GitHub Copilot repository-specific context for the SMRF codebase, following the pattern established in iSnobal/awsm#36 PR.

Contents

  • Repository description — SMRF's role as the spatial forcing engine for AWSM
  • Repository structure — Key package directories and their responsibilities
  • Code style & standards — References iSnobal org-level agents in .github/instructions/ (Ruff, NumPy docstrings, Cython, snow physics, etc.)
  • Domain context — SMRF↔AWSM↔pysnobal model relationships; topocalc dependency for topographic layers (load_topo.py, toporad.py); inicheck-managed .ini config files
  • Review style — Conciseness, physical correctness over style, no repeat comments
  • Testing & build — Verified against Makefile: make build_extensions tests and python3 -m unittest smrf/tests/data/test_topo.py
Original prompt

Create a repository-wide instruction set for the SMRF repository to provide context for GitHub Copilot. These instructions are adapted from the standard established in AWSM PR 36 but tailored specifically for SMRF's role and structure.

Instructions Content

Copilot Instructions for SMRF

Repository Description

The Spatial Modeling for Resources Framework (SMRF) is a Python-based framework designed to provide a modular approach to spatial modeling of meteorological data. SMRF acts as the primary forcing data engine for the Automated Water Supply Model (iSnobal/awsm), distributing point measurements or gridded data over a digital elevation model (DEM) to provide inputs for snow mass and energy balance models.

Repository Structure

The project follows a modular Python package structure:

  • smrf/: Main package directory.
    • cli/: Command-line interface implementations.
    • data/: Default configuration files, static resources, and sample data.
    • distribute/: Classes for distributing meteorological variables (temp, precip, etc.).
    • envphys/: Physical calculations for environmental variables (e.g., radiation, vapor pressure).
    • framework/: Core logic for model execution, threading, and data management.
    • output/: Handlers for various output formats (e.g., NetCDF).
    • spatial/: Spatial operations and handling of DEM/grid data.
    • tests/: Unit and integration tests.
    • utils/: Common utility functions and helpers.
  • docs/: Sphinx documentation.
  • pyproject.toml & Makefile: Build system and task automation.

Key Guidelines

1. Code Style & Standards

Adhere to the specialized iSnobal organization agents defined in iSnobal/.github:

  • Python Style: Follow @iSnobal/.github/instructions/python-style-agent.md for Ruff formatting, type hints, and naming conventions.
  • Legacy Migration: Consult @iSnobal/.github/instructions/legacy-migrator-agent.md when refactoring complex or obscure legacy code.
  • Documentation: Follow @iSnobal/.github/instructions/documentation-agent.md for NumPy-style docstrings and RST formatting.
  • Dependencies: Consult @iSnobal/.github/instructions/dependency-modernization-agent.md for Conda-based environment management.
  • Performance: Use @iSnobal/.github/instructions/performance-cython-agent.md for C/Cython optimizations and NumPy vectorization.
  • Snow Physics: Defer to @iSnobal/.github/instructions/snow-physics-agent.md for physical correctness in radiation and energy balance logic.

2. Domain Context

  • Models: Always consider the relationship between SMRF (forcing data/spatial modeling), pysnobal (iSnobal wrapper), and iSnobal/awsm (orchestrator). SMRF provides the critical spatial distribution of meteorological variables required by iSnobal/awsm to drive snow mass and energy balance models.
  • Topographic Context: SMRF relies on iSnobal/topocalc for all topographic processing (slope, aspect, skyview, etc.). When performing domain context checks or modifying spatial calculations (e.g., in smrf/data/load_topo.py or smrf/envphys/solar/toporad.py), ensure the dependency on iSnobal/topocalc is maintained for physical consistency and topographic layer generation.
  • Config Files: SMRF heavily relies on .ini configuration files (managed via inicheck). Ensure any changes to distribution methods or parameters are reflected in the expected .ini structure to maintain compatibility with model initialization and iSnobal/awsm orchestration workflows.

3. Review Style

When providing feedback or reviewing code:

  • Conciseness: Be short and concise; explain the "why" behind recommendations.
  • Clarification: Ask clarifying questions when code intent is unclear.
  • Efficiency: Do not repeat comments that were previously resolved on new pushes.
  • Context: Do not repeat any information that was already in the PR description.
  • Prioritization: Focus on logic and physical correctness over purely technical changes.

4. Testing & Build

Follow the specialized @iSnobal/.github/instructions/testing-coverage-agent.md for detailed quality and coverage standards:

  • Framework: Use the standard Python unittest framework for all tests.
  • Location: Place new tests in smrf/tests.
  • Execution:
    • Build extensions and run all tests: make build_extensions tests
    • Run specific test file: python3 -m unittest smrf/tests/data/test_topo.py

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Revisit the 2. Domain Context and rewrite the models section from scratch and combine with Topocalc

Assistant: I have rewritten the Domain Context section to specifically focus on the relationship between SMRF, AWSM, and the topocalc dependency as requested.

Updated Domain Context Section:

### 2. Domain Context
- **Model Ecosystem & Topocalc**: SMRF serves as the spatial...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI changed the title [WIP] Add Copilot instructions for SMRF repository Add GitHub Copilot instructions for SMRF Apr 3, 2026
Copilot AI requested a review from jomey April 3, 2026 21:27
Copilot finished work on behalf of jomey April 3, 2026 21:27
@jomey jomey requested review from Hedrick-ARS and Copilot April 3, 2026 21:40
@jomey jomey marked this pull request as ready for review April 3, 2026 21:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repository-specific GitHub Copilot guidance for the SMRF codebase by moving from a generic instruction stub to a detailed .github/copilot-instructions.md aligned with SMRF’s domain and structure.

Changes:

  • Removes the old generic Copilot review guidance file under .github/instructions/.
  • Adds .github/copilot-instructions.md describing SMRF’s purpose, package layout, domain context (AWSM/topocalc/inicheck), and suggested test commands.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/instructions/copilot-instructions.md Removes the previous generic Copilot instruction stub.
.github/copilot-instructions.md Introduces SMRF-specific Copilot instructions (repo structure, domain context, review/testing guidance).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Copilot AI and others added 3 commits April 3, 2026 15:59
Use the higher level instructions under .github instead.
This was the actual file generated
@jomey jomey force-pushed the copilot/add-copilot-instructions-for-smrf branch from 06bd931 to 4382031 Compare April 3, 2026 22:00
@jomey jomey changed the title Add GitHub Copilot instructions for SMRF Update GitHub Copilot instructions for SMRF Apr 17, 2026
@jomey
Copy link
Copy Markdown
Member

jomey commented Apr 17, 2026

Now that the organization wide instructions are merged, these are the updates specific to SMRF

@jomey jomey merged commit 2683a7e into main Apr 21, 2026
6 checks passed
@jomey jomey deleted the copilot/add-copilot-instructions-for-smrf branch April 21, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants