Distributive-Network / bifrost2

The Python SDK for DCP
8 stars 0 forks source link

Feature/initial bifrost2 #1

Closed wiwichips closed 3 months ago

wiwichips commented 4 months ago

Initial Bifrost 2 Structure

This PR contains the base set up for Bifrost 2 (the new Python SDK for DCP). It outlines the file structure of the module, and the dev tools used (poetry for Python management and testing, pminit for npm install for instance).

File structure

bifrost2/
├── dcp
│   ├── api
│   │   ├── compute_for.py
│   │   ├── __init__.py
│   │   ├── job.py
│   │   └── result_handle.py
│   ├── dry
│   │   ├── aio.py
│   │   ├── class_manager.py
│   │   ├── class_registry.py
│   │   └── __init__.py
│   ├── initialization.py
│   ├── __init__.py
│   └── js
│       ├── __init__.py
│       ├── load_dcp_client.py
│       ├── node_modules/
│       │   └── dcp-client -> (dcp-client via npm)
│       ├── package.json
│       ├── package-lock.json
│       └── utils.py
├── example.py
├── poetry.lock
├── pyproject.toml
├── README.md
└── tests
    └── (test files here)

Module logic is in dcp/, tests are in tests/...

dcp.api

dcp.dry

dcp.js

(note: the file structure is subject to change and may have changed by the time you review this PR)

Module initialization algorithm

When dcp.init() is called a module system is programatically generated which matches the JavaScript CJS modules. At the same time, any classes, or functions come across are automatically converted to more Pythonic structures.

List of things this PR does

wiwichips commented 4 months ago

internal implementation details are leaked when one imports dcp, need to limit that

wiwichips commented 4 months ago

bfclass class maker is ugly and should be cleaned up

wiwichips commented 3 months ago

Merging now since this is the initial PR which will enable others to contribute.