# behradmoadeli/haulmax architecture

> Architecture diagram of the GitHub repository behradmoadeli/haulmax, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/behradmoadeli/haulmax
- Repository: https://github.com/behradmoadeli/haulmax

## Overview

1. **Repository purpose**
   - This repo is a **data preparation / data quality workspace** for the “haulmax” project, centered on synchronizing shared datasets, converting source files into analysis-friendly formats, and profiling the incoming “bronze” data layer.

2. **Primary architectural style**
   - The repo is **data-pipeline oriented**, not an application service. Its main flow is:
     - shared data storage → local DVC checkout → transformation scripts → parquet outputs / profiling reports → notebooks for exploration.

3. **Data management boundary**
   - **DVC** is the key infrastructure layer.
   - `data.dvc` and `.dvc/` indicate that the actual datasets are stored outside Git and pulled into the workspace from a remote.
   - The README configures the DVC remote to a **local OneDrive-mounted folder**, so the repository depends on external shared storage rather than an API or database.

4. **Environment and runtime**
   - `environment.yml` defines the Conda environment used for the workflow.
   - `pyproject.toml` suggests Python packaging/tooling for the scripts and tests.
   - The repo is therefore a **Python batch/data engineering project**, likely run from the command line or notebooks.

5. **Ingestion / source synchronization**
   - The repository does not appear to ingest data from live systems directly.
   - Instead, the source data is synchronized manually via OneDrive and then fetched into the working directory with `dvc pull`.
   - This creates a clear separation between **shared storage** and **local analysis workspace**.

6. **Transformation layer**
   - `scripts/csv_to_parquet.py` and `scripts/csv_to_parquet_eqstatus.py` are the main processing entry points.
   - Their role is to convert raw CSV inputs into **Parquet** outputs, implying a columnar storage step for downstream analysis and profiling.
   - Having separate scripts suggests at least two source shapes/domains: general CSV data and an equipment-status-specific dataset.

7. **Profiling / data quality layer**
   - `scripts/profile_bronze_sources.py` and `reports/bronze_profile_report.md` form the data profiling branch of the workflow.
   - This is the quality-assurance boundary: raw/bronze inputs are inspected, summarized, and documented before broader use.
   - The report artifact indicates the profiling step is meant to be persisted and reviewed, not just run interactively.

8. **Tests as pipeline safeguards**
   - `scripts/test_csv_to_parquet.py` and `scripts/test_csv_to_parquet_eqstatus.py` provide script-level validation.
   - These tests likely verify transformation correctness and guard against regressions in data conversion logic.

9. **Exploration and analysis layer**
   - `notebooks/eda.ipynb` is the active exploratory analysis workspace.
   - The `legacy/` notebooks show earlier experiments and demos, including segmentation and predictive-event work, but they appear historical rather than core to the current pipeline.

10. **Outputs and artifacts**
   - The important artifacts in this repo are not application binaries; they are:
     - DVC-managed datasets
     - converted Parquet files
     - profiling reports
     - notebook outputs / exploratory analyses
   - This makes the repo useful as an **analysis and preprocessing hub**.

11. **Key boundaries to show in a diagram**
   - Separate these layers clearly:
     - **External shared storage**: OneDrive-backed DVC remote
     - **Local workspace**: pulled datasets and code
     - **Processing scripts**: CSV-to-Parquet and profiling utilities
     - **Validation**: tests
     - **Exploration/reporting**: notebooks and markdown reports
   - The major dependency is data flow, not service-to-service communication.

12. **What is notably absent**
   - There is no sign of a web server, message bus, database service, or deployment pipeline in the current tree.
   - Architecture should therefore focus on **batch data preparation and analysis**, with DVC as the central coordination mechanism for data assets.

Main entry points: [`scripts/csv_to_parquet.py`](https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet.py) (CSV to Parquet), [`scripts/csv_to_parquet_eqstatus.py`](https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet_eqstatus.py) (Eq status convert), [`scripts/profile_bronze_sources.py`](https://github.com/behradmoadeli/haulmax/blob/main/scripts/profile_bronze_sources.py) (Bronze profile), [`environment.yml`](https://github.com/behradmoadeli/haulmax/blob/main/environment.yml) (Conda env)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_external["External storage"]
  node_onedrive_remote[("OneDrive remote<br/>dvc remote")]
end

subgraph group_data["Data workspace"]
  node_data_manifest["Data manifest<br/>dvc tracking<br/>[data.dvc]"]
  node_local_data[("Pulled data<br/>local dataset")]
end

subgraph group_processing["Processing"]
  node_csv_parquet["CSV to Parquet<br/>transform script<br/>[csv_to_parquet.py]"]
  node_eqstatus_parquet["Eq status convert<br/>transform script"]
  node_parquet_output[("Parquet outputs<br/>data artifact")]
end

subgraph group_quality["Quality"]
  node_bronze_profile["Bronze profile<br/>profiling script"]
  node_profile_report["Profile report"]
  node_csv_test["CSV tests"]
  node_eqstatus_test["Eq tests"]
end

subgraph group_analysis["Analysis"]
  node_eda_nb["EDA notebook<br/>[eda.ipynb]"]
  node_legacy_notebooks["Legacy notebooks<br/>notebook set"]
end

subgraph group_tooling["Tooling"]
  node_dvc_config["DVC config<br/>[config]"]
  node_environment["Conda env<br/>runtime env<br/>[environment.yml]"]
  node_project_tooling["Pyproject<br/>python tooling<br/>[pyproject.toml]"]
end

node_onedrive_remote -->|"configured by"| node_dvc_config
node_dvc_config -->|"controls"| node_data_manifest
node_data_manifest -->|"pulls"| node_local_data
node_local_data -->|"feeds"| node_csv_parquet
node_local_data -->|"feeds"| node_eqstatus_parquet
node_local_data -->|"profiles"| node_bronze_profile
node_csv_parquet -->|"writes"| node_parquet_output
node_eqstatus_parquet -->|"writes"| node_parquet_output
node_bronze_profile -->|"documents"| node_profile_report
node_csv_test -.->|"validates"| node_csv_parquet
node_eqstatus_test -.->|"validates"| node_eqstatus_parquet
node_environment -->|"runs"| node_csv_parquet
node_environment -->|"runs"| node_bronze_profile
node_project_tooling -->|"supports"| node_csv_parquet
node_project_tooling -->|"supports"| node_eda_nb
node_eda_nb -->|"explores"| node_parquet_output
node_legacy_notebooks -.->|"historical analysis"| node_local_data

click node_dvc_config "https://github.com/behradmoadeli/haulmax/blob/main/.dvc/config"
click node_data_manifest "https://github.com/behradmoadeli/haulmax/blob/main/data.dvc"
click node_csv_parquet "https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet.py"
click node_eqstatus_parquet "https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet_eqstatus.py"
click node_bronze_profile "https://github.com/behradmoadeli/haulmax/blob/main/scripts/profile_bronze_sources.py"
click node_profile_report "https://github.com/behradmoadeli/haulmax/blob/main/reports/bronze_profile_report.md"
click node_csv_test "https://github.com/behradmoadeli/haulmax/blob/main/scripts/test_csv_to_parquet.py"
click node_eqstatus_test "https://github.com/behradmoadeli/haulmax/blob/main/scripts/test_csv_to_parquet_eqstatus.py"
click node_eda_nb "https://github.com/behradmoadeli/haulmax/blob/main/notebooks/eda.ipynb"
click node_legacy_notebooks "https://github.com/behradmoadeli/haulmax/blob/main/legacy/DEMO_segment_equipment_data.ipynb"
click node_environment "https://github.com/behradmoadeli/haulmax/blob/main/environment.yml"
click node_project_tooling "https://github.com/behradmoadeli/haulmax/blob/main/pyproject.toml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_onedrive_remote toneBlue
class node_data_manifest,node_local_data toneAmber
class node_csv_parquet,node_eqstatus_parquet,node_parquet_output toneMint
class node_bronze_profile,node_profile_report,node_csv_test,node_eqstatus_test toneRose
class node_eda_nb,node_legacy_notebooks toneIndigo
class node_dvc_config,node_environment,node_project_tooling toneTeal
```

## Components

### External storage

Shared dataset location outside Git, used as the DVC remote.

- **OneDrive remote**: dvc remote · Shared external storage configured as the DVC backend for datasets.

### Data workspace

Tracked data and local pulled datasets used by the pipeline.

- [Data manifest](https://github.com/behradmoadeli/haulmax/blob/main/data.dvc): dvc tracking · DVC-tracked dataset definition for pulling managed data into the workspace. · `data.dvc`
- **Pulled data**: local dataset · Workspace copy of shared datasets fetched via DVC for processing and analysis.

### Processing

Batch scripts that convert source CSVs into analysis-ready outputs.

- [CSV to Parquet](https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet.py): transform script · Main conversion entry point for general CSV inputs. · `scripts/csv_to_parquet.py`
- [Eq status convert](https://github.com/behradmoadeli/haulmax/blob/main/scripts/csv_to_parquet_eqstatus.py): transform script · Specialized conversion path for equipment-status CSV inputs. · `scripts/csv_to_parquet_eqstatus.py`
- **Parquet outputs**: data artifact · Converted columnar outputs used for downstream analysis.

### Quality

Profiling and validation around bronze inputs and conversions.

- [Bronze profile](https://github.com/behradmoadeli/haulmax/blob/main/scripts/profile_bronze_sources.py): profiling script · Profiles bronze-layer sources and produces quality summaries. · `scripts/profile_bronze_sources.py`
- [Profile report](https://github.com/behradmoadeli/haulmax/blob/main/reports/bronze_profile_report.md): report · Persisted markdown summary of bronze-source profiling results. · `reports/bronze_profile_report.md`
- [CSV tests](https://github.com/behradmoadeli/haulmax/blob/main/scripts/test_csv_to_parquet.py): test · Checks the general CSV-to-Parquet conversion path. · `scripts/test_csv_to_parquet.py`
- [Eq tests](https://github.com/behradmoadeli/haulmax/blob/main/scripts/test_csv_to_parquet_eqstatus.py): test · Checks the equipment-status conversion path. · `scripts/test_csv_to_parquet_eqstatus.py`

### Analysis

Notebooks and human-readable reports for exploration.

- [EDA notebook](https://github.com/behradmoadeli/haulmax/blob/main/notebooks/eda.ipynb): notebook · Current exploratory analysis workspace. · `notebooks/eda.ipynb`
- [Legacy notebooks](https://github.com/behradmoadeli/haulmax/blob/main/legacy/DEMO_segment_equipment_data.ipynb): notebook set · Historical experiments and demos kept for reference. · `legacy/DEMO_segment_equipment_data.ipynb`

### Tooling

Python environment and project metadata supporting the workflow.

- [DVC config](https://github.com/behradmoadeli/haulmax/blob/main/.dvc/config): dvc config · Repository DVC settings that point the workspace at the shared remote. · `.dvc/config`
- [Conda env](https://github.com/behradmoadeli/haulmax/blob/main/environment.yml): runtime env · Environment specification for running the pipeline and notebooks. · `environment.yml`
- [Pyproject](https://github.com/behradmoadeli/haulmax/blob/main/pyproject.toml): python tooling · Python project metadata and tooling configuration. · `pyproject.toml`

## Connections

- OneDrive remote → DVC config: configured by · The shared remote is defined in the repository DVC configuration.
- DVC config → Data manifest: controls · DVC settings govern which tracked data can be pulled into the workspace.
- Data manifest → Pulled data: pulls · The DVC manifest materializes shared datasets as local workspace copies.
- Pulled data → CSV to Parquet: feeds · Pulled raw data is converted by the main CSV processing script.
- Pulled data → Eq status convert: feeds · Equipment-status sources are converted by the specialized script.
- Pulled data → Bronze profile: profiles · Bronze inputs are summarized and quality-checked before broader use.
- CSV to Parquet → Parquet outputs: writes · General conversion produces parquet artifacts.
- Eq status convert → Parquet outputs: writes · Equipment-status conversion also produces parquet artifacts.
- Bronze profile → Profile report: documents · Profiling results are persisted as a markdown report.
- CSV tests → CSV to Parquet: validates · Test coverage protects the general conversion path.
- Eq tests → Eq status convert: validates · Test coverage protects the equipment-status conversion path.
- Conda env → CSV to Parquet: runs · The Conda environment supports the batch conversion scripts.
- Conda env → Bronze profile: runs · The same environment supports profiling workflows.
- Pyproject → CSV to Parquet: supports · Python project tooling underpins script execution and packaging.
- Pyproject → EDA notebook: supports · Project tooling also supports notebook-based analysis.
- EDA notebook → Parquet outputs: explores · Exploration consumes transformed data artifacts.
- Legacy notebooks → Pulled data: historical analysis · Legacy notebooks reflect earlier analysis work on the pulled datasets.
