How ferdesmello/drake-metaculus works
1. Repository shape
- This is a small, single-purpose Python analysis project centered on one script, drake_metaculus.py.
- The repo is organized around data inputs and generated figures, not around multiple services or a package/module hierarchy.
2. Primary computation goal
- The script computes a distribution for the Drake equation output N, rather than a single estimate.
- Each Drake parameter is modeled as a probability distribution derived from Metaculus forecasts, and those distributions are combined to produce the final distribution of possible detectable civilizations.
3. Input data subsystem
- The data/ directory contains seven parameter-specific folders, one for each Drake equation term:
R_s, f_p, n_e, f_l, f_i, f_c, and L.
- Each folder contains:
- question_data.csv for question-level metadata / target definition.
- forecast_data.csv for forecast distributions over time.
- a local README.md documenting that parameter’s source question.
- This is the repo’s main data boundary: the script consumes these CSVs as the offline source of truth.
4. External data acquisition boundary
- The script supports three modes via a data_type switch:
- 0: use local CSVs from data/
- 1: pull the user’s own forecast data from Metaculus API
- 2: pull aggregated forecast data from Metaculus API
- So the architecture has a clear split between offline reproducible analysis and online API-backed ingestion.
- Metaculus is the only external service that materially affects the pipeline.
5. Forecast parsing layer
- The README indicates the script parses Metaculus forecast outputs into PDFs and CDFs for each parameter.
- This parsing is a notable architectural boundary because the code is sensitive to Metaculus response format changes; the README explicitly notes multiple breakages from API format changes.
- In other words, the ingestion/parsing layer is brittle and tightly coupled to Metaculus output structure.
6. Parameter-level modeling
- Each of the seven Drake variables is treated as its own probabilistic input rather than a fixed constant.
- The repo’s structure mirrors this one-parameter-per-folder design, which suggests the pipeline likely processes each parameter independently before combining them.
- This modularity is important for diagramming: each parameter is a separate input stream feeding the final aggregation step.
7. Aggregation / simulation core
- The central analytical step is combining the seven parameter distributions to compute the resulting distribution of N.
- Conceptually, this is the main transformation boundary:
Metaculus forecast distributions → derived parameter distributions → final Drake equation distribution.
- The README emphasizes that the output is itself a distribution, so the code likely performs numerical sampling or distribution convolution-style computation rather than direct algebraic evaluation.
8. Visualization/output subsystem
- The figures/ directory holds generated plots, including the final distribution graphic referenced in the README.
- These figures are the primary output artifact of the repo, intended for inspection rather than downstream machine consumption.
- No database, web UI, or persistent backend is present; outputs are static files.
9. Execution model
- The whole pipeline is run by executing drake_metaculus.py.
- The runtime appears to be a single-process batch analysis job that takes about a minute on the author’s machine.
- That makes the architecture straightforward: one script orchestrates ingestion, parsing, computation, and plotting end-to-end.
10. Operational implications
- The repo is optimized for reproducible research / exploratory computation, not for serving or interactive use.
- The most important operational dependency is the availability and format stability of Metaculus data.
- The local CSV mode acts as a reproducible fallback when API access is unavailable.
11. What to show in an architecture diagram
- A good diagram would have:
- seven parameter-specific data sources in data/
- optional Metaculus API ingestion on the side
- one central Python analysis step
- a final visualization/output node writing into figures/
- The key flow is forecast data in → parsed distributions → combined Drake equation output → saved plots.
Main entry points: drake_metaculus.py drake_metaculus.py · Drake's_Equation_First_Parameter_R_s R_s data · Drake's_Equation_Second_Parameter_f_p f_p data · Drake's_Equation_Third_Parameter_n_e n_e data
Components 15
External
Metaculus is the only upstream service boundary.
- Metaculus API · Online source for personal or aggregated forecast data.
Data
Offline parameter forecasts and question metadata for each Drake term.
- R_s data · First Drake parameter inputs and metadata.
data/Drake's_Equation_First_Parameter_R_s - f_p data · Second Drake parameter inputs and metadata.
data/Drake's_Equation_Second_Parameter_f_p - n_e data · Third Drake parameter inputs and metadata.
data/Drake's_Equation_Third_Parameter_n_e - f_l data · Fourth Drake parameter inputs and metadata.
data/Drake's_Equation_Fourth_Parameter_f_l - f_i data · Fifth Drake parameter inputs and metadata.
data/Drake's_Equation_Fifth_Parameter_f_i - f_c data · Sixth Drake parameter inputs and metadata.
data/Drake's_Equation_Sixth_Parameter_f_c - L data · Seventh Drake parameter inputs and metadata.
data/Drake's_Equation_Seventh_Parameter_L
Analysis
Single-script batch pipeline that parses, models, aggregates, and plots.
- drake_metaculus.py · Single entrypoint that runs the full pipeline.
drake_metaculus.py - Forecast parser · Converts Metaculus outputs and local CSVs into usable PDFs/CDFs.
- Parameter models · Builds one probability distribution per Drake variable.
- Drake aggregator · Combines the seven parameter distributions into the final N distribution.
- N distribution · Derived distribution over detectable civilizations.
Output
Generated static figures from the final Drake distribution.
- Figure writer · Renders the final distribution and related plots.
- figures/ · Static output directory for saved plots.
figures
Connections 16
- Metaculus API → Forecast parser: API forecasts · Feeds online forecast data when data_type selects Metaculus.
- R_s data → Forecast parser: CSV inputs · Offline source of truth for the first Drake parameter.
- f_p data → Forecast parser: CSV inputs · Offline source of truth for the second Drake parameter.
- n_e data → Forecast parser: CSV inputs · Offline source of truth for the third Drake parameter.
- f_l data → Forecast parser: CSV inputs · Offline source of truth for the fourth Drake parameter.
- f_i data → Forecast parser: CSV inputs · Offline source of truth for the fifth Drake parameter.
- f_c data → Forecast parser: CSV inputs · Offline source of truth for the sixth Drake parameter.
- L data → Forecast parser: CSV inputs · Offline source of truth for the seventh Drake parameter.
- drake_metaculus.py → Forecast parser: orchestrates · Single script selects the ingestion mode and runs parsing.
- Forecast parser → Parameter models: PDF/CDFs · Parses Metaculus response structure into parameter distributions.
- Parameter models → Drake aggregator: 7 distributions · Seven independent Drake terms feed the combined calculation.
- drake_metaculus.py → Drake aggregator: batch compute · Executes the central analytical step end to end.
- Drake aggregator → N distribution: N · Produces the final distribution for the Drake equation output.
- N distribution → Figure writer: plot input · The computed distribution is visualized as static figures.
- drake_metaculus.py → Figure writer: renders · Script finishes by generating plots from the computed result.
- Figure writer → figures/: saved plots · Generated figures are written to the figures directory.