uncertainty-and-units
Skill này làm gì
Công cụ này giúp đảm bảo các phép tính khoa học đúng về đơn vị (như mét, giây) và độ không chắc chắn (mức độ đáng tin cậy của một con số). Nó chuyển đổi đơn vị, tính sự lan truyền sai số và trình bày kết quả rõ ràng.
Khi nào nên dùng
- ✓Khi chuyển đổi đơn vị trong các phép tính khoa học.
- ✓Khi tính độ không chắc chắn của một kết quả từ nhiều phép đo.
- ✓Khi trình bày kết quả đo sao cho người đọc hiểu được độ không chắc chắn.
Liên kết skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/uncertainty-and-units/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đổi 10 kilômét mỗi giờ sang mét mỗi giây và cho tôi biết độ không chắc chắn.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng các thư viện chuyên biệt để theo dõi đơn vị và độ không chắc chắn xuyên suốt quá trình tính toán. Nó đảm bảo đơn vị được xử lý đúng và sai số được lan truyền theo phương pháp khoa học đã được chấp nhận.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Uncertainty and units
Scope
Use this skill whenever a calculation carries physical units or a reported number needs an uncertainty. Concretely:
- converting between units, including conversions that need a physical context (wavelength to photon energy, mass to amount of substance, energy to temperature);
- propagating uncertainty through a measurement model, with or without correlated inputs;
- building a GUM uncertainty budget from calibration certificates, specifications, and repeatability data;
- choosing a coverage factor and deciding whether
k = 2is defensible; - rounding and writing a result so a reader knows what the
±means; - extracting parameter uncertainties from a curve fit without discarding correlations;
- reviewing existing analysis code for silent unit and uncertainty defects;
- checking that a dimensionally consistent answer is also physically possible — the order of magnitude, the dimensionless group, and the regime it implies.
This skill covers the metrology and the two libraries that implement it. It does not
cover statistical inference, model selection, or study design — see statistical-analysis,
statistical-power, and experimental-design.
Current release and installation
Verified 2026-10-01:
- pint 0.26.1, released 2026-09-10; requires Python 3.12+.
- uncertainties 3.2.3, released 2025-04-21; requires Python 3.8+.
- NumPy 2.5.3 and SciPy 1.18.1; both require Python 3.12+.
scipy.constantsin SciPy 1.18.1 serves CODATA 2022. SciPy 1.11 and earlier served CODATA 2018; the switch to CODATA 2022 occurred in SciPy 1.15.
uv venv --python 3.13
source .venv/bin/activate
uv pip install "pint==0.26.1" "uncertainties==3.2.3" "numpy==2.5.3" "scipy==1.18.1"
pint-pandas and pint-xarray add unit-aware columns and arrays and are separate
installs.
Non-negotiable workflow
- Attach units at input and strip them only at output. Convert at function
boundaries with
ureg.wrapsorm_as("unit"), never mid-calculation. - Write the measurement model explicitly before computing anything, including corrections whose estimated value is zero. A correction left out of the model leaves its uncertainty out of the budget.
- Give every input four things: an estimate, a standard uncertainty, the distribution the uncertainty came from, and its degrees of freedom.
- Convert Type B statements with the right divisor. A certificate's expanded
uncertainty divides by its stated
k; rectangular limits divide bysqrt(3). - Identify correlations before combining. A shared calibration, instrument correction, or fit can induce correlation; quantify shared components instead of assuming every pair is correlated.
- Compute sensitivity coefficients, and read the budget from
c_i * u(x_i)rather than from the raw uncertainties. - Check the linearization. Compare propagated distributions with the GUM interval when in doubt. Establish Monte Carlo numerical stability before a JCGM 101 clause 8 claim; neither method validates the measurement model or the assigned input PDFs.
- Justify coverage. A Student-t factor from effective degrees of freedom is an approximation requiring suitable distributional assumptions.
- Round the uncertainty first, then the value to the same decimal place.
- State what the
±is — standard or expanded, withk, the coverage probability, and the method. - Sanity-check the magnitude before reporting. A dimensionally consistent result can still be impossible. Compare it against a known scale or a dimensionless group, and confirm every assumption you relied on still holds in that regime.
The failures this skill exists to prevent
Each of the following runs without error and produces a plausible number.
A unit stripped at an unknown scale
length = (12.7 * ureg.mm).magnitude # 12.7 -- of what?
length = (12.7 * ureg.mm).m_as("m") # 0.0127 metres, stated
.magnitude returns whatever the quantity happened to be carrying. Name the unit at the
point of extraction, every time.
Offset temperature arithmetic
Q(20, "degC") + Q(5, "degC") # OffsetUnitCalculusError -- correctly refused
Q(20, "degC") + Q(5, "delta_degC") # 25 degree_Celsius
Q(25, "degC") - Q(20, "degC") # 5 delta_degree_Celsius
…
Câu hỏi thường gặp
Đơn vị vật lý là gì?
Đó là các chuẩn để đo đại lượng như chiều dài (mét), thời gian (giây) hoặc khối lượng (kilôgam).
Độ không chắc chắn của phép đo là gì?
Đó là khoảng xung quanh giá trị đo được, trong đó giá trị thật được kỳ vọng nằm với một xác suất nhất định.
Vì sao theo dõi đơn vị và độ không chắc chắn lại quan trọng?
Để đảm bảo độ chính xác, khả năng so sánh và độ tin cậy của kết quả khoa học, tránh các lỗi thường gặp trong tính toán phức tạp.
Chi tiết
Mô tả gốc của tác giả
Tracks physical units and propagates measurement uncertainty in scientific calculations using pint and uncertainties. Use for unit conversion and dimensional checking, GUM uncertainty budgets, Type A and Type B evaluation, coverage factors and expanded uncertainty, Monte Carlo propagation, significant-figure and plus-minus reporting, error propagation through curve fits, CODATA constants, auditing
Độ phổ biến
- Sao GitHub
- 51k
- Vị trí xếp hạng
- #3589
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
13c-metabolic-flux
51kƯớc tính thông lượng chuyển hóa bằng dữ liệu theo dõi đồng vị carbon-13. Hữu ích để phân tích chuyển hóa tế bào và các con đường sinh hóa.
adaptyv
51kThiết kế thí nghiệm đặc trưng protein bằng Adaptyv API. Hỗ trợ ước tính chi phí, gửi trình tự và theo dõi kết quả phòng thí nghiệm.
aeon
51kThực hiện các tác vụ học máy trên dữ liệu chuỗi thời gian. Hữu ích để phân loại, dự báo, phát hiện bất thường và tìm mẫu trong dữ liệu tuần tự.
alphagenome
51kTra cứu các tác động di truyền đã được tính trước cho biến thể gen. Cung cấp điểm số và giải thích để hiểu ảnh hưởng của biến thể lên bộ gen.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.