# carlosgcz/doing-data-science architecture

> Architecture diagram of the GitHub repository carlosgcz/doing-data-science, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carlosgcz/doing-data-science
- Repository: https://github.com/carlosgcz/doing-data-science

## Overview

Based on your project’s file tree and README, the project is clearly a data science repository organized around different “chapters” (in this sample, chapter-02) that cover specific topics—in this case, Statistical Inference and Exploratory Data Analysis (EDA). The repository supports both Python and R analyses (as evidenced by the Python notebooks, RMarkdown files, and RStudio project files) and includes datasets (CSV files) used across the analyses.

##### Main Components
- Repository Root: This includes overarching configuration files such as LICENSE, .gitignore, requirements.txt (for Python), and the RStudio project files (.Rproj, .RData, .Rhistory). Represent these as the “Project Configuration” or “Environment Setup.”
- Chapters: In your case, “chapter-02” is one such module. For multi-chapter projects, treat each chapter as a self-contained module that includes data and analysis.
- Data Layer: Within each chapter, the data directory holds multiple CSV files (e.g., nyt1.csv, nyt2.csv, etc.). Represent this as the “Data Source” component.
- Analysis/Notebooks Layer: The “notebook” directory contains Jupyter notebooks (.ipynb) and RMarkdown files (.Rmd, .html) which perform data analysis, EDA, and possibly automation tasks. This is your “Processing/Analysis” unit.
- Documentation: Each chapter includes its own README.md, and there is an overarching README in the root directory. This part describes the purpose, usage, and architecture, ensuring that end-users understand the context.

##### Relationships and Interactions
- Documentation: Although not involved in executing analysis, the documentation provides context for each chapter and should be linked to the respective chapter analysis module.

##### Architectural Patterns and Principles
- Reproducibility: Emphasize the separation between raw data, analysis scripts, and environment configuration to capture the reproducibility principle.

##### Relevant Technologies and Tools
- Python (Jupyter notebooks, requirements.txt dependencies)
- R (RMarkdown files, RStudio project files, .RData, .Rhistory)
- File-based datasets (CSV files)
- Git for version control (implied by .gitignore)
- Documentation (README files)

## Diagram (Mermaid)

```mermaid
flowchart TD
    EnvSetup["Project Configuration / Environment Setup"]:::config
    RootDoc["Root Documentation (README.md)"]:::doc

    subgraph "Chapter-02 Module"
        Chapter02["Module: Chapter-02"]:::config
        Data02["Data Source (CSV Files)"]:::data
        Analysis02["Processing/Analysis (Notebooks & RMarkdown)"]:::analysis
        Doc02["Chapter Documentation (README.md)"]:::doc
    end

    %% Composition relationships within Chapter-02 Module
    Chapter02 --> Data02
    Chapter02 --> Analysis02
    Chapter02 --> Doc02

    %% Data Flow from Data Source to Analysis Unit
    Data02 -->|"dataflow"| Analysis02

    %% Analysis dependency on Project Configuration
    Analysis02 -->|"dependsOn"| EnvSetup

    %% Documentation providing context to analysis and configuration
    Doc02 -->|"context"| Analysis02
    RootDoc -->|"context"| EnvSetup

    %% Click Events
    click EnvSetup "https://github.com/carlosgcz/doing-data-science/blob/main/."
    click Chapter02 "https://github.com/carlosgcz/doing-data-science/tree/main/chapter-02"
    click Data02 "https://github.com/carlosgcz/doing-data-science/tree/main/chapter-02/data"
    click Analysis02 "https://github.com/carlosgcz/doing-data-science/tree/main/chapter-02/notebook"

    %% Styles
    classDef config fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef data fill:#FFE4B5,stroke:#000,stroke-width:2px;
    classDef analysis fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef doc fill:#FFB6C1,stroke:#000,stroke-width:2px;
```
