Skip to main content

SysML v2 dependency analysis, notebook generation, execution, and view extraction tool

Project description

Windseeker

Python Jupyter SysML CLI Status

Windseeker is a command-line tool for SysML v2 dependency analysis, notebook generation, execution, and view extraction.

It scans .sysml files, analyzes package dependencies, generates a dependency-ordered SysML Jupyter notebook, executes that notebook using a SysML kernel, and extracts rendered views as images.


AI Assisted Development

This project has used generative AI to assist in the development of the tool.

✨ Features

Model Analysis

  • Recursively scans .sysml files
  • Extracts top-level packages only
  • Detects import dependencies
  • Builds a directed dependency graph
  • Fails fast on:
    • Import cycles
    • Imports referencing missing packages

Notebook Generation

  • Generates a single-kernel SysML Jupyter notebook
  • One code cell per top-level package
  • Cells ordered by dependency order
  • Nested packages remain embedded in their parent cell
  • Appends additional cells for each discovered view
    • Uses %view Fully::Qualified::ViewName

Notebook Execution

  • Executes the generated notebook programmatically
  • Supports:
    • nbclient (preferred)
    • jupyter nbconvert --execute (fallback)
  • Detects errors via:
    • Jupyter error outputs
    • SysML kernel stderr (ERROR, Exception, Traceback)

View Image Extraction

  • Extracts rendered views from executed notebooks
  • Supports:
    • SVG (raw XML)
    • PNG (transparent or solid background)
    • Optional JPG
  • Automatically rescales oversized SVGs to avoid Cairo rendering errors

🚀 Quick Start

1) Install Windseeker

Clone the repository and install locally:

pip install -e .

This installs the windseeker CLI command.


2) Install Python Dependencies

If you prefer manual installation:

pip install -r requirements.txt

3) Ensure a SysML Jupyter Kernel Is Installed

Windseeker requires a SysML kernel registered with Jupyter.

Verify:

jupyter kernelspec list

You must see a kernel such as:

sysml

Kernel installation is tool-specific and cannot be handled via requirements.txt or pyproject.toml.


4) Minimal Example Model

Create tests/simple.sysml:

package DemoSystem {

  port def DbPort {
    in item query  : String;
    out item result : String;
  }

  part def UI {
    out port db : DbPort;
  }

  part def ElasticDB {
    in port api : ~DbPort;
  }

  part def System {
    part ui : UI;
    part db : ElasticDB;
    connect ui.db to db.api;
  }

  package Views {
    view uiDbConnection {
      expose DemoSystem::System::ui;
      expose DemoSystem::System::db;
    }
  }
}

5) Run Windseeker

windseeker run

This performs:

  1. SysML file scanning
  2. Dependency graph construction
  3. Cycle and missing-import validation
  4. Notebook generation
  5. Notebook execution
  6. View image extraction

🧰 CLI Usage

Show help

windseeker --help

Run the full pipeline

windseeker run

Common CLI Examples

Disable graph image generation

windseeker run --no-graph

Specify a custom graph output

windseeker run --graph --graph-png my_graph.png

Skip notebook execution (generate only)

windseeker run --no-execute

Extract views with an opaque PNG background

windseeker run --png-opaque --png-bg "#ffffff"

Change input folder

windseeker run --folder ./models

Print dependency order only

windseeker order

This prints the topological package order without generating any output artifacts.


📂 Output Artifacts

File / Folder Description
packages_in_dependency_order.sysml Concatenated SysML source in dependency order
packages_in_dependency_order.ipynb Generated SysML Jupyter notebook
packages_in_dependency_order_executed.ipynb Executed notebook with outputs
views/ Extracted view images (.svg, .png, optional .jpg)

🧠 Design Principles

  • Top-level packages = notebook cells
  • Nested packages stay embedded in their parent
  • Imports are resolved at the top-level package granularity
  • Views are fully qualified (e.g. System::Views::MyView)
  • Fail early, fail clearly

🧠 CLI Design Notes

  • The CLI is implemented using Typer (Click-based) for:
    • Strong typing
    • Clear --help output
    • Explicit boolean flags (--flag / --no-flag)
  • Boolean toggles are always separated from path arguments (e.g. --graph vs --graph-png)
  • All validation failures (cycles, missing packages, execution errors) result in a non-zero exit code, making the tool CI-friendly

⚠️ Common Errors & Fixes

No such kernel named sysml

  • The SysML kernel is not registered
  • Run jupyter kernelspec list
  • Install and register the kernel

Cairo INVALID_SIZE error

  • SVG view is too large
  • Automatically handled via scaling logic
  • Tunable via max_dim_px / max_pixels

Missing package error

  • An import references a package not found in the scanned files
  • Either add the package or ignore it explicitly

🧩 Extensibility

Windseeker is designed to be extended easily:

  • Additional CLI commands
  • CI integration
  • JSON dependency reports
  • Multiple view renderers
  • Alternative image formats
  • View grouping or filtering

📜 License

This project is intended as a tooling and analysis aid for SysML v2 models. No official affiliation with OMG or any SysML v2 tool vendor is implied.

Development setup (recommended)

Install dev dependencies and enable pre-commit hooks:

pip install -e ".[dev]"
pre-commit install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windseeker-1.1.3.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windseeker-1.1.3-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file windseeker-1.1.3.tar.gz.

File metadata

  • Download URL: windseeker-1.1.3.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for windseeker-1.1.3.tar.gz
Algorithm Hash digest
SHA256 7ddb66bf8210641d04877d2788dd467a6b6764ad5dcf78174affbec265fe8e0d
MD5 80c5f6937473d4a1c26b5f9286d0f51d
BLAKE2b-256 ff054f856d8110badf666a7fdf209d31a1c26d68b4333044fee1898c9e38885d

See more details on using hashes here.

File details

Details for the file windseeker-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: windseeker-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for windseeker-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 291f8785885fdc84855f517ae6a9c9a8e44a4ac39ad653bccfbd7e0061bcda9b
MD5 996dc6b6eddfd5c18a0af34ae4712b4b
BLAKE2b-256 5e65b918a71d592933b4cf638768bb28ae4b5bfe015b4c1e6ee574cc17141f57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page