home / skills / eyadsibai / ltk / scientific-computing

scientific-computing skill

/plugins/ltk-data/skills/scientific-computing

This skill helps you perform scientific computing tasks by leveraging AstroPy, BioPython, SymPy, and Statsmodels for precise calculations, data analysis, and

npx playbooks add skill eyadsibai/ltk --skill scientific-computing

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.6 KB
---
name: scientific-computing
description: Use when "scientific computing", "astronomy", "astropy", "bioinformatics", "biopython", "symbolic math", "sympy", "statistics", "statsmodels", "scientific Python"
version: 1.0.0
---

# Scientific Computing

Domain-specific Python libraries for scientific applications.

## Libraries

| Library | Domain | Purpose |
|---------|--------|---------|
| **AstroPy** | Astronomy | Coordinates, units, FITS files |
| **BioPython** | Bioinformatics | Sequences, BLAST, PDB |
| **SymPy** | Mathematics | Symbolic computation |
| **Statsmodels** | Statistics | Statistical modeling, tests |

---

## AstroPy

Astronomy and astrophysics computations.

**Key capabilities:**

- **Units**: Physical unit handling with automatic conversion
- **Coordinates**: Celestial coordinate systems (ICRS, galactic, etc.)
- **Time**: Astronomical time scales (UTC, TAI, Julian dates)
- **FITS**: Read/write FITS astronomical data format

**Key concept**: Unit-aware calculations prevent errors from unit mismatches.

---

## BioPython

Bioinformatics - sequences, structures, databases.

**Key capabilities:**

- **Sequences**: DNA/RNA/protein manipulation, translation, complement
- **File parsing**: FASTA, GenBank, PDB formats
- **BLAST**: Local and remote sequence alignment
- **NCBI Entrez**: Database access (nucleotide, protein, taxonomy)

**Key concept**: `SeqIO` for reading any sequence format, `Seq` for sequence operations.

---

## SymPy

Symbolic mathematics - algebra, calculus, equation solving.

**Key capabilities:**

- **Algebra**: Solve equations, simplify, expand, factor
- **Calculus**: Derivatives, integrals, limits, series
- **Linear algebra**: Matrix operations, eigenvalues
- **Printing**: LaTeX output for documentation

**Key concept**: Work with symbols, not numbers. Get exact answers, not approximations.

---

## Statsmodels

Statistical modeling with R-like formula interface.

**Key capabilities:**

- **Regression**: OLS, logistic, generalized linear models
- **Time series**: ARIMA, VAR, state space models
- **Statistical tests**: t-tests, ANOVA, diagnostics
- **Formula API**: R-style formulas (`y ~ x1 + x2`)

**Key concept**: `model.summary()` gives comprehensive statistical output like R.

---

## Decision Guide

| Domain | Library |
|--------|---------|
| Astronomy/astrophysics | AstroPy |
| Biology/genetics | BioPython |
| Symbolic math | SymPy |
| Statistical analysis | Statsmodels |
| Numerical computing | NumPy, SciPy |
| Data manipulation | Pandas |

## Resources

- AstroPy: <https://docs.astropy.org>
- BioPython: <https://biopython.org/docs/>
- SymPy: <https://docs.sympy.org>
- Statsmodels: <https://www.statsmodels.org>

Overview

This skill packages guidance for choosing and using domain-specific Python libraries for scientific computing. It highlights AstroPy, BioPython, SymPy, and Statsmodels and links each library to its primary domain and common tasks. Use it to match problems to libraries and to follow practical usage patterns for astronomy, bioinformatics, symbolic math, and statistical modeling.

How this skill works

The skill inspects the scientific task and recommends the most suitable Python library based on domain: astronomy → AstroPy, biology/genetics → BioPython, symbolic math → SymPy, statistics → Statsmodels. It summarizes key capabilities (units/coordinates, sequence handling, symbolic manipulation, regression/time-series) and points to relevant APIs and concepts. It also suggests complementary tools (NumPy, SciPy, Pandas) when numerical computing or data manipulation is required.

When to use it

  • You need unit-aware astronomical calculations, coordinate transforms, or FITS file I/O.
  • You are processing biological sequences, parsing FASTA/GenBank/PDB, or running BLAST/Entrez queries.
  • You require exact symbolic algebra, analytic derivatives, integrals, or closed-form solutions.
  • You are building statistical models, running regressions, time-series analysis, or diagnostic tests.
  • You want a clear decision path to pick libraries for scientific Python workflows.

Best practices

  • Pick the domain-specialized library first (AstroPy/BioPython/SymPy/Statsmodels) and add NumPy/SciPy/Pandas for numerical and data tasks.
  • Use unit-aware types (AstroPy units) to avoid unit conversion bugs; prefer explicit unit conversion over implicit assumptions.
  • For bioinformatics, centralize format parsing with SeqIO/Parsers and validate sequences before downstream analysis.
  • In symbolic tasks, represent unknowns as symbols and simplify results before numeric evaluation to detect exact solutions.
  • When modeling with Statsmodels, use the formula API for clear model specification and always inspect model.summary() and diagnostics.

Example use cases

  • Convert between celestial coordinate systems and read/write FITS images with AstroPy for telescope data pipelines.
  • Parse multi-sequence FASTA files, translate DNA to protein, and submit BLAST searches with BioPython in genomics pipelines.
  • Derive analytic integrals and simplify symbolic expressions for control theory or physics problems using SymPy.
  • Fit linear and generalized linear models, run ARIMA on economic time series, and perform hypothesis tests with Statsmodels.
  • Combine Pandas for data cleaning, NumPy/SciPy for numerical routines, and a domain library (e.g., AstroPy) for end-to-end scientific workflows.

FAQ

Which library should I learn first for general scientific Python?

Start with NumPy and Pandas for numerical arrays and tabular data, then add domain libraries (AstroPy, BioPython, SymPy, Statsmodels) as your specific needs arise.

Can I mix symbolic and numeric workflows?

Yes. Use SymPy to get exact symbolic results, then convert expressions to numeric functions (lambdify) for evaluation with NumPy or SciPy when needed.