How benmsanderson/meteor works
Project type and purpose
• METEOR is a Python-based scientific library (“package”) for multivariate emulation of time-evolving climate responses.
• It provides core emulation functionality plus data-retrieval from CMIP6, a simple-climate-model wrapper, pattern-fitting routines, and plotting utilities.
• Users interact via Python scripts, CLI-style entry points (e.g., meteor.py), and Jupyter notebooks for demonstrations and figure generation.
File structure
• Top-level:
• src/meteor – core library modules
• notebooks/ – demonstration and paper-figure notebooks
• scripts/ – standalone example scripts
• tests/ – unit and integration tests, test data
• docs/ – documentation build files
• Makefile, setup.py, requirements.txt – build, install, and CI config
• Key modules in src/meteor:
• cmip6_meteor_data_getter.py – external CMIP6 data interface
• scm_forcer_engine.py – simple climate model wrapper for forcings
• prpatt.py – pattern fitting and convolution routines
• meteor.py – main control logic (entry point)
• meteor_plot_utils.py – plotting helpers
• default_scm_data/ – built-in data files for certain scenarios
• CI/CD: GitHub Actions workflows under .github/workflows.
README for additional insights
• Describes installation, development flow, testing commands, and high-level “General code flow”:
• meteor.py orchestrates control
• prpatt.py fits parameters & processes PDRMIP output
• scm_forcer_engine.py wraps simple climate model for forcing strength
• meteor_plot_utils.py for plots
• cmip6_meteor_data_getter.py for Xarray-backed CMIP6 access
1) User Interface Layer
– Jupyter Notebooks
– Scripts/CLI entry points (e.g., meteor.py, scripts/*.py)
2) Core Emulation Library
– Meteor Control Module (meteor.py)
– Pattern Fitting Module (prpatt.py)
– Forcing Engine Module (scm_forcer_engine.py)
– Plot Utilities Module (meteor_plot_utils.py)
3) Data Access Layer
– CMIP6 Data Getter (cmip6_meteor_data_getter.py) → external Zarr store
– Default SCM Data (built-in text files)
4) Testing & CI
– Unit Tests (tests/unit)
– Integration Tests (tests/integration)
– GitHub Actions (ci-cd-workflow.yml)
5) Build & Deployment
– Makefile targets & virtual-environment
– setup.py / setup.cfg for packaging
– User Interface Layer → invokes Core Emulation Library APIs
– Core Emulation Library → calls Data Access Layer for input datasets
– Forcing Engine may call external simple climate model code (via wrapper)
– Core modules produce outputs (time-series, patterns) → handed to Plot Utilities
– Plot Utilities → generate figures in notebooks or scripts
– Tests invoke modules to validate functionality
– CI workflow triggers build, tests, linting on GitHub push
c. Architectural patterns & design principles:
– Modular separation: data retrieval, computation, plotting, orchestration
– Layered architecture: UI → API → Data
– Dependency inversion: core modules depend on interfaces for data access
– Packaging best practices: setup.py, versioneer, continuous integration
d. Relevant technologies & libraries:
– Python ecosystem: Xarray, NumPy, SciPy, Matplotlib (via meteor_plot_utils)
– CMIP6 Zarr cloud storage API
– pytest for tests, versioneer for versioning, GitHub Actions for CI
– Makefile for environment management