بنقرة واحدة
coding-style
Coding philosophy, conventions, and expectations for Python code.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Coding philosophy, conventions, and expectations for Python code.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Style guidelines for writing manuscript text.
Job dispatch infrastructure. Use when packaging a python script for batch / parallel execution, locally or on SLURM.
Guide for controlling Adobe Illustrator via MCP tools and osascript.
Extract scientific journal article PDFs to lossless Markdown using MinerU. Assumes a pre-existing conda env named "mineru".
Agent roles, models, and the dispatch pattern for delegating to subagents.
Executive role for an agent that dispatches subagents.
| name | coding-style |
| description | Coding philosophy, conventions, and expectations for Python code. |
Be a collaborator, not a code bot. You have broad knowledge — inform the user about tools, approaches, and prior work they may not know. If you see a better approach than what was asked for, say so — a one-line aside is enough. Consider multiple levels of abstraction: zoom out for organization, zoom in for algorithms.
This is the real world and often out of your training distribution. Prefer careful incremental progress over one-shot attempts. When uncertain, ask.
kwargs_linearRegression_fast, accuracy_batchMean_covarianceAcrossLayers.prepare_params, generate_latents.filepath_* for files, dir_* for directories, plurals for collections (filepaths_models).func(x=x, y=y).pathlib.Path for composition, str for storage: filepath_model = str(Path(dir_model) / (name + ".pth")).Import top-level libraries, call via namespace (torch.nn.functional.cosine_similarity(...)). Exceptions: from tqdm.auto import tqdm, from pathlib import Path.
Group by category with blank-line separators:
from typing import List ## typing
import os
import sys
from pathlib import Path ## built-ins
import numpy as np
import torch ## third-party
import basic_neural_processing_modules as bnpm ## personal
from .model_def import build_model ## local
Docstrings: RST/Google-style, nested descriptions for Args and Returns. Don't restate defaults visible in the signature. Even small utilities need docstrings. Document Raises: for non-obvious exceptions.
def phase_correlation(
im_template: Union[np.ndarray, torch.Tensor],
im_moving: Union[np.ndarray, torch.Tensor],
mask_fft: Optional[Union[np.ndarray, torch.Tensor]] = None,
eps: float = 1e-8,
) -> Tuple[np.ndarray, ...]:
"""
Perform phase correlation on two images along last two axes (height, width).
Args:
im_template (np.ndarray):
Template image(s). Shape: (..., height, width).
im_moving (np.ndarray):
Moving image. Must broadcast with template.
mask_fft (Optional[np.ndarray]):
2D FFT mask. ``None`` means no masking.
eps (float):
Prevents division by zero.
Returns:
(Tuple[np.ndarray, ...]):
cc (np.ndarray): Phase correlation coefficient.
"""
Comments: inline for shapes, types, broadcasting. Step headers (## Section) every 3–10 lines. References to papers and equations encouraged.
if: raise() not assert, rigid shapes. See JAX gotchas.[None, ...] not .unsqueeze(0). No .squeeze(). torch.as_tensor(...) for ingestion.np.memmap or zarr. Save results as .npy/.npz.del tensor; torch.cuda.empty_cache()). Use configurable device strings..csv, .json) for small data. For large arrays, .npy/.npz. For complex structures, richfile. Try to never pickle.try/except is generally wrong; let failures surface.if x is None not if x.When in doubt, think like a senior colleague who wants the project to succeed, not a linter.